This folder contains the source code to many ASLM examples. There are two flavors of examples in this folder. The first includes examples that were done by the ASLM engineering team mainly to test parts of ASLM and to provide some debugging tools. These include the Inspector, TestTools, and ExampleLibrary examples. The other example were done specifically to demonstrate how to do certains things with the ASLM or make use of ASLM features. They are usually easier to read, more to the point, and better documented then the other examples. They include Sample INIT, Sample Apps, FunctionSetInfo, and Example Tools.
The best way to use the examples is to use MPW's search command to look for whatever class, function, or export file info you want to see an example of and then have a look at the source and maybe even change it around so you can get a better understanding of it.
Folder organization
===================
All of the examples folders are set up the same way. The sources are in the :sources: folder, the built tools and libraries end up in the :built: folder, and the object files end up in the :objects: folder. The makefile(s) are in the example folder itself. The Example Tools folder has a BuildExample script instead of a makefile. If an example has more than one makefile, execute the makefile that builds the shared libraries first and the tools or applications second.
PPC vs. 68K
==========
Three of the examples have been converted to native PowerPC: Inspector, TestTools, and ExampleLibrary. PowerPC binaries will always end with "PPC".
Since some of the examples are MPW tools and no shipping version of MPW supports native tools, none of the the MPW tools were converted to native PowerPC. The "Tests" menu has been added to InspectorPPC to support the functionality of the TestTool MPW tool. The TestExampleClassPPC application was written to provide some of the functionality of the LibraryMgrTest1 MPW tool.
Compiler Support
================
The Inspector, TestTools, and ExampleLibrary examples all support CFront, SCpp, and MrC. There is a separate makefile for each compiler type and each makefile will place the executables in a separate subfolder of the :Built: folder and will place the objects in a separate folder of the :Objects: folder.
Universal Includes
================
All of the examples use the Universal Includes which means a version of MPW that supports the Universal Includes should be used (ETO #15 or later).
Building the examples
====================
Make sure that whenever you build an example you always copy it's shared library (if it has one) into the Extensions folder before you run the example (unless you want to see ASLM exception handling in action!).
In order to build the examples you need to do three things: (1) Set {SLMInterfaces} to the directory where the ASLM interface files are located and export it. (2) Set {SLMLibraries} to the folder where the ASLM libraries are located and export it. (3) Either add the directory where the ASLM tools are located to your {Commands} path or copy the tools into the MPW Scripts and Tools folders. If your ASLM Developer Tools folder is inserted at the root of the hard disk "HD", the following will work.
set SCIncludes "{MPW}Interfaces:SCIncludes:"
export SCIncludes
set SCLibraries "{MPW}Libraries:SCLibraries:"
export SCLibraries
set SLMInterfaces "HD:ASLM Developer Tools:Interfaces:"
export SLMInterfaces
set SLMLibraries "HD:ASLM Developer Tools:Libraries:"
export SLMLibraries
set Commands "HD:ASLM Developer Tools:Tools:,{Commands}"
You must be in the directory containing the makefile in order get the example to build. If you want to build all the example in one shot, then set the current directory to the ASLM Examples folder and then execute the following: